#define  _CRT_SECURE_NO_WARNINGS
//11
int main()
{
	int s = 0;
	int v = 0;
	scanf("%d%d", &s, &v);
	int max = s / v+10;
	if (s % v)max++;
	int MM = 0;
	MM = 60 - max % 60;
	int HH = 0;
	HH = 8 - max / 60 - 1;
	if (HH < 0)
		HH += 24;
	printf("%02d:%02d", HH,MM);
	return 0;
}